﻿@using MrCMS.Helpers
@model System.Collections.Generic.List<MrCMS.Web.Areas.Admin.Models.MessageTemplateInfo>
@{
    ViewBag.Title = "Message Templates";
    Layout = "~/Areas/Admin/Views/Shared/_Layout.cshtml";
}

<h1 class="page-header">@Resource("Admin Message Templates Title", "Message Templates")</h1>
<table class="table table-condensed table-striped">
    @foreach (var item in Model)
    {
        <tr>
            <td>
                @item.Type.Name.BreakUpString()
            </td>
            <td>
                <div class="btn-group">
                    @(item.Id.HasValue
                        ? Html.ActionLink(Resource("Edit"), "Edit", new { Id = item.Id }, new { @class = "btn btn-default btn-xs" })
                        : Html.ActionLink(Resource("Add"), "Add", new { type = item.Type.FullName }, new { @class = "btn btn-xs btn-primary" }))
                    @if (item.CanPreview)
                    {
                        @Html.ActionLink(Resource("Preview"), "Preview", "MessageTemplate", new { id = item.Id }, new { @class = "btn btn-xs btn-default ", data_toggle = "fb-modal" })
                    }
                </div>
            </td>
        </tr>
    }
</table>
